Skip to content

feat(github): show a single multi-env plan change inline#680

Merged
Kiran01bm merged 2 commits into
mainfrom
kiran01bm/plan-inline-single-ddl
Jul 6, 2026
Merged

feat(github): show a single multi-env plan change inline#680
Kiran01bm merged 2 commits into
mainfrom
kiran01bm/plan-inline-single-ddl

Conversation

@Kiran01bm

@Kiran01bm Kiran01bm commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Multi-environment plan comments collapse each environment's DDL behind a
<details> block so a large plan doesn't dominate the comment. For a plan
with just one change that collapse adds a needless click. This renders a
single change inline and only collapses when there is more than one.

The threshold is the total change count (DDL statements + VSchema diffs),
so a lone VSchema change is also shown inline, not just a lone SQL
statement. Single-environment plans already rendered inline; this only
affects the per-environment sections of a multi-env comment.

Behavior

0 changes  ->  "No schema changes detected"
1 change   ->  rendered inline (no <details>)
1 change  ->  <details><summary>Show SQL (N statements)</summary> ...

Only collapse a multi-environment plan section's DDL behind a details
block when it has more than one change. A single statement (or a lone
VSchema diff) is small enough to read without a click, so render it
inline while keeping the summary below.
Copilot AI review requested due to automatic review settings July 4, 2026 06:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the UX of multi-environment plan comments by rendering per-environment plan output inline when there is exactly one total change (DDL statements + VSchema diffs), and only collapsing the “detailed changes” section behind a <details> block when there is more than one change.

Changes:

  • Update multi-env per-environment rendering to inline a single change and collapse only when totalChanges > 1.
  • Add/adjust tests to cover the new “single change inline” behavior while preserving collapse behavior and singular/plural summary text.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pkg/webhook/templates/plan.go Inline-render single-change environment sections; keep <details> collapse for multi-change sections.
pkg/webhook/plan_test.go Add a new test for single-change inline rendering; keep coverage for collapse summary wording.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Kiran01bm Kiran01bm marked this pull request as ready for review July 6, 2026 00:14
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@Kiran01bm Kiran01bm merged commit 296d774 into main Jul 6, 2026
32 checks passed
@Kiran01bm Kiran01bm deleted the kiran01bm/plan-inline-single-ddl branch July 6, 2026 02:16
Kiran01bm added a commit that referenced this pull request Jul 6, 2026
…ew-drift-rollup

* origin/main:
  feat(github): show a single multi-env plan change inline (#680)
  fix(github): parse any configured environment in -e flag (#679)
  chore(deps): bump block/vitess for mysqltopo notification refcount fix (#678)
  feat(github): summarize unsafe changes with a count (#674)
  feat(github): collapse multi-env plan DDL behind a details block (#673)
  fix(tern): fail closed on drives outside the client's database scope (#672)
  fix(serve): stop the operator before closing the gRPC client (#676)
  fix(tern): notify late-registered observers of settled applies (#675)
  chore(deps): bump block/vitess to release-24.0 head (mysqltopo fixes) (#655)
  docs(agents): forbid rendering untrusted error strings in PR markdown (#671)
  docs(agents): assert Close only on a handle's sole owner (#670)
  feat(api): verify the reviewed plan's origin deployment at rollup time (#669)
  fix(github): acknowledge a command only when a deployment acts on it (#664)
  fix(github): leader re-folds on its own schedule when participants have not reported (#668)
  test(github): cover the review-time deployment drift gate end to end (#667)
  fix(github): reject contradictory revert and skip-revert commands (#637)
  fix(tern): queue dispatched applies for the operator drive (#635)
  feat(github): list authorized teams and users on command rejection (#665)

# Conflicts:
#	pkg/webhook/plan.go
#	pkg/webhook/plan_drift.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants